#include<iostream>
#include<algorithm>
using namespace std;
int score[10005];
int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&score[i]);
	}
	sort(score,score+n,greater<int>());
	printf("%d ",score[(n-1)/2]);
	int cnt = 0;
	for(int i=0;i<n;i++){
		if(score[i]>=score[(n-1)/2]){
			cnt++;
		}else{
			break;
		}
	}
	printf("%d\n",cnt);
	return 0;
}
